import cv2
import matplotlib.pyplot as plt
import numpy as np
from numba import uint8

def cv_show(name,img):
    cv2.imshow(name,img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

img = cv2.imread('C:/Users/nic/Desktop/opencv/picture/girl.jpg')

scharrx = cv2.Scharr(img,cv2.CV_64F,1,0)
scharrx = cv2.convertScaleAbs(scharrx)
scharry = cv2.Sobel(img,cv2.CV_64F,0,1)
scharry = cv2.convertScaleAbs(scharry)
scharrxy = cv2.addWeighted(scharrx,0.5,scharrx,0.5,0)
#stack
res = np.hstack((scharrx,scharry,scharrxy))
cv_show('all_image',res)

laplacion = cv2.Laplacian(img,cv2.CV_64F)
laplacion = cv2.convertScaleAbs(laplacion)
cv_show('all_image',laplacion)







